package org.example;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class Teacher {
    @Value("汤姆")
    private String name;
    @Value("mousing")
    private String course;
    public void teach() {System.out.print("老师名字：" + name + " 教授课程：" + course);
    }
}
